/*
 * @version: 1.0
 * @Author: zhl
 * @Date: 2021-09-10 11:12:26
 * @LastEditors: zhl
 * @LastEditTime: 2021-09-13 10:23:52
 * @Description: 文件实现描述
 */
#ifndef __GET_REQUEST_H__
#define __GET_REQUEST_H__

#include "dlt698_frame.h"
#include "CConfigManager.h"
#include "global_data_struct.h"
#include <memory>
#include <mutex>
#include <iostream>
#include <unordered_map>

typedef enum _GET_REQUEST_TYPE{
    GET_REQUEST_NORMAL       = 1,    //读取一个对象属性
    GET_REQUEST_NORMAL_LIST  = 2,    //读取若干个对象属性
    GET_REQUEST_RECORD       = 3,    //读取一个记录型对象属性
    GET_REQUEST_RECORD_LIST  = 4,    //读取若干个记录型对象属性
    GET_REQUEST_NEXT         = 5,    //读取分帧传输的下一帧
    GET_REQUEST_MD5          = 6     //读取一个对象属性的 MD5 值
}GET_REQUEST_TYPE;


class GETRequest
{
private:
    /* data */
    static GETRequest c_instance;

    PIID  c_piid;
    std::mutex c_piid_mutex;

public:
    GETRequest(/* args */);
    ~GETRequest();

    PIID get_piid();

    static GETRequest *getInstance();

    int get_request(std::shared_ptr<CConfigManager> cm, TASK_PARAMS *task_params,  uint8_t *apdu, int len);
    int get_request_next(int request_id, uint8_t *apdu, int len, PIID piid);
};









#endif /* __GET_REQUEST_H__ */